package com.zto.sch.base;

import java.util.HashMap;

/**
 * @program: sch-diy-parent
 * @description:
 * @author: sch
 * @create: 2021-03-26 15:23
 **/
public class StaticMethodObj {

}

class CanWeOverrideStaticMethod {

    public static void main(String args[]) {
        HashMap hashMap = new HashMap();
        hashMap.put(1, "aa");

        Screen scrn = new ColorScreen();

        //if we can  override static , this should call method from Child class
        scrn.show(); //IDE will show warning, static method should be called from classname

    }

}

class Screen {
    /*
     * public static method which can not be overridden in Java
     */
    public static void show() {
        System.out.println("fu...");
    }
}

class ColorScreen extends Screen {
    /*
     * static method of same name and method signature as existed in super
     * class, this is not method overriding instead this is called
     * method hiding in Java
     */
    public static void show() {
        System.err.println("zi...");
    }
}